<template>
  <div class="app">
    我是主应用
    <div>
      <button @click="$store.state.count--">-</button>
      <span>{{ $store.state.count }}</span>
      <button @click="$store.state.count++">+</button>
    </div>
    <div id="micro-con"></div>
  </div>
</template>

<script>
export default {
  name: 'app',
  data() {
    return {
      randomKey: Math.random()
    }
  },
  created() {
    window.$store = {state: this.$data}
  },
  computed: {
    calRandomKey() {
      return window.$store?.state?.randomKey
    }
  },
  methods: {
    handleDivClick() {
      console.log('ggg base', window.$store)
    }
  }
}
</script>

<style scoped lang="scss">
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  #micro-con {
    margin: 20px 0;
    flex-grow: 1;
    outline: 1px solid red;
  }
}
</style>
